package org.dingyom.gift.clients;

import feign.hystrix.FallbackFactory;
import org.dingyom.gift.domain.LoginUser;
import org.dingyom.gift.util.AjaxResult;
import org.springframework.stereotype.Component;

@Component
public class LoginUserClientFallbackFactory implements FallbackFactory<LoginUserClient> {
    /**
     * 降级回调
     * @param cause
     * @return
     */
    @Override
    public LoginUserClient create(Throwable cause) {
        return new LoginUserClient() {
            @Override
            public AjaxResult saveUser(LoginUser loginuser) {
                cause.printStackTrace();
                return null;
            }

            @Override
            public AjaxResult oauthTest(Long id) {
                cause.printStackTrace();
                return null;
            }
        };
    }

}
